package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Lists;
import com.sc.nft.entity.vo.mall.OrderRefundTypeVO;
import com.sc.nft.entity.vo.mall.RefundReasonVO;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@Getter
public enum MallOrderRefundTypeEnum {

    //售后类型: 1:仅退款 2:退货退款
    ONLY_REFUND(1,"仅退款"),
    REFUNDS(2,"退货退款"),
    EXCHANGE(3,"换货"),
            ;
    @EnumValue
    private int code;
    private String description;

    public static List<OrderRefundTypeVO> getMallOrderRefundTypeList(){
        ArrayList<OrderRefundTypeVO> list = Lists.newArrayList();
        OrderRefundTypeVO orderRefundTypeVO = new OrderRefundTypeVO();
        orderRefundTypeVO.setTypeName(ONLY_REFUND.getDescription());
        orderRefundTypeVO.setType(ONLY_REFUND.toString());
        list.add(orderRefundTypeVO);
        OrderRefundTypeVO refundsType = new OrderRefundTypeVO();
        refundsType.setTypeName(REFUNDS.getDescription());
        refundsType.setType(REFUNDS.toString());
        list.add(refundsType);
        OrderRefundTypeVO exchangeType = new OrderRefundTypeVO();
        exchangeType.setTypeName(EXCHANGE.getDescription());
        exchangeType.setType(EXCHANGE.toString());
        list.add(exchangeType);
        return list;
    }

    public static List<OrderRefundTypeVO> getVirtualMallOrderRefundTypeList(){
        ArrayList<OrderRefundTypeVO> list = Lists.newArrayList();
        OrderRefundTypeVO orderRefundTypeVO = new OrderRefundTypeVO();
        orderRefundTypeVO.setTypeName(ONLY_REFUND.getDescription());
        orderRefundTypeVO.setType(ONLY_REFUND.toString());
        list.add(orderRefundTypeVO);
        return list;
    }

    public static List<MallOrderRefundTypeEnum> getUsersCanReturnGoodsList(){
        List<MallOrderRefundTypeEnum> usersCanReturnGoodsList = Lists.newArrayList();
        usersCanReturnGoodsList.add(REFUNDS);
        usersCanReturnGoodsList.add(EXCHANGE);
        return usersCanReturnGoodsList;
    }
}
